<?php
namespace Goatherd\Content\Engine\Resource;

use Goatherd\Commons\Collection\IEntity;

/**
 * Resource container.
 *
 * Abstract resources are the combination of arbitrary content
 * (pointer, URI, object, or other) and meta information.
 *
 * They can provide automated or on demand casting capabilities like
 * data normalisation.
 *
 * Meta is arbitrary data itself but labelled using scalar values (=keys).
 * It is intended for readers and mappers to define a set of meta keys and
 * provide according validation/ conversion logic.
 *
 * @category ContentEngine
 * @package Goatherd\Content\Engine
 * @subpackage Resource
 */
interface IResource
extends IEntity
{
    /**
     * Identifier must not be altered later on.
     *
     * @param mixed $identifier
     */
    public function __construct($identifier);

    /**
     * Data depends on actual reader/ mapper used.
     *
     * @param mixed $content
     */
    public function setContent($content);

    /**
     *
     * @return mixed
     */
    public function getContent();
}